package com.matt.foundation.constant;

import lombok.Setter;

/**
 * *******************************
 * Created by Ron.
 * form com.matt
 * on 2018/3/15
 * *******************************
 */
public class ObservationConstant {
    public enum Category {
        NURSERY(1, "托班"),
        EARLY(2, "早教"),
        ;

        @Setter
        private int code;

        @Setter
        private String value;

        Category(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public Category get(int code){
            for (Category type : values()) {
                if (type.codeOf()==code)
                    return type;
            }
            return null;
        }
    }

    public enum Status {
        NO_TEST(0, "未评测"),
        TESTED(1, "已评测"),
        ;

        @Setter
        private int code;

        @Setter
        private String value;

        Status(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int codeOf(){
            return code;
        }

        public String valueOf(){
            return value;
        }

        public Status get(int code){
            for (Status status : values()) {
                if (status.codeOf()==code)
                    return status;
            }
            return null;
        }
    }
}
